FROM maven:3.6-jdk-11-slim AS build
VOLUME /root/.m2
WORKDIR /app
COPY . .
RUN mvn clean package -DskipTests

FROM openjdk:11-jre-slim-stretch
WORKDIR /app
VOLUME /tmp
EXPOSE 10001
COPY --from=build /app/starters/starter-eureka-server/target/*.jar app.jar
ENTRYPOINT ["java","-jar","app.jar"]
